<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 扩展运算符
        // 扩展运算符（spread）是三个点（...）。将一个数组转为用逗号分隔的参数序列。
        console.log(...[1, 2, 3])


        function add(x, y) {
            return x + y;
        }

        const numbers = [4, 38];
        let a=add(...numbers) // 42
        console.log(a)

        
    </script>
</body>

</html>